package com.scl.controller;

import com.scl.bean.Tadmin;
import com.scl.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("admin")

//允许跨域
@CrossOrigin
public class AdminController {
    //依赖注入
    @Autowired
    AdminService adminService;

    @RequestMapping("list")   //请求映射
    public List<Tadmin> getList(){
        List<Tadmin> list=adminService.list();
        return list;
    }

}
